﻿@model IEnumerable<TaoNiuOA.Models.TaskType>
@{
    ViewBag.Title = "任务类型";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}
<fieldset>
    <legend><a href="/Task/index">任务管理</a> | <a href="/Task/approve">审批任务</a> | 类型管理</legend>
    <p>
        @Html.ActionLink("添加类型", "Create")
    </p>
    <div id="divtip" style="text-align: center; color: Red; font-size: larger;">
    </div>
    <table>
        <tr>
            <th>
                类型名称
            </th>
            <th>
                描述
            </th>
            <th>
                排序
            </th>
            <th>
                操作
            </th>
        </tr>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.TypeName)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Desc)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Sort)
                </td>
                <td>
                    @Html.ActionLink("查看/编辑", "Edit", new { id = item.TaskTypeID })
                    | <a href="javascript:del(@item.TaskTypeID)">删除</a>
                </td>
            </tr>
        }
    </table>
</fieldset>
<script src="../../Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
    function del(obj) {
        if (confirm("您确定要删除吗?")) {
            $.post("delete/" + obj, function (data) {
                $("#divtip").html(data);
                if (data == "删除成功")
                    window.location.reload();
            });
        }
    }
</script>
